const mongoose = require("./baseDB/index");
const UserSchema = new mongoose.Schema({
    name: String,
    password: String,
    collected: [
        {
            url:String,
            img:String,
            title:String,
            detailTitle:String,
            price:String,
            detailMsg:Array,
            sold:Number
        }
    ],
    history: [
        {
            url:String,
            img:String,
            title:String,
            detailTitle:String,
            price:String,
            detailMsg:Array,
            sold:Number
        }
    ],
    paid: [
        {
            url:String,
            img:String,
            title:String,
            detailTitle:String,
            price:String,
            detailMsg:Array,
            sold:Number,
            size:Number,
            num:Number
        }
    ],
    cart: [
        {
            url:String,
            img:String,
            title:String,
            detailTitle:String,
            price:String,
            detailMsg:Array,
            sold:Number,
            size:Number,
            num:Number
        }
    ],
    icon:String
}, {
    versionKey: false
})

var UserModel = mongoose.model('User', UserSchema, 'user');  //是我们获取的数据库里movie的那张表

module.exports = UserModel;